<!DOCTYPE html>
<html>
<head>
    <!--[if lt IE 7]>
    <div class="ie6_error">还在用<strong>漏洞百出的IE6浏览器</strong>么？为了您的网络安全，请升级浏览器 <a target="_blank"
                                                                               href="http://browsehappy.com">立即升级</a>
    </div>
    <![endif]-->

    <meta charset="utf-8">
    <title>购物车步骤1-文具1号</title>
    <meta name="description"
          content="文具1号作为上海办公用品供货商公司,专为世界500强企业及SOHO办公族提供网上商城一站式办公耗材批发及采购服务,一站式选购办公日用文具用品,厂家直销,好货又便宜【阳光采购就上文具1号 阳光价格 老板放心 品质保障 员工省力】"/>
    <meta name="keywords" content="办公用品,办公文具,办公文具网站,文具网站,办公用品网,文具采购网,金万年"/>
    <meta name="copyright" content="上海易推信息科技有限公司"/>
    <meta name="renderer" content="webkit">
    <base href="<?php echo base_url(); ?>"/>
    <link rel="stylesheet" type="text/css" href="public/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/popup.css?v=0.00002"/>
    <link rel="stylesheet" type="text/css" href="public/css/layer.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/buyer_cart.css?v=0.00009"/>
    <link rel="stylesheet" type="text/css" href="public/css/new_add_css.css?v=0.000005"/>
    <!--[if lte IE 9]>
    <script type="text/javascript" src="../public/js/html5shiv-printshiv-3.js"></script>
    <![endif]-->
    <script src="public/js/jquery.1.7.1-min.js" type="text/javascript" charset="utf-8"></script>
    <style type="text/css">
    #empty1 {
        background: url('<?php echo base_url();?>public/images/c_empty.png') no-repeat scroll 40px 86px rgba(0, 0, 0, 0);
        padding: 88px 0 100px 156px;
        position: relative;
    }

    #empty1 ul {
        line-height: 20px;
        margin-top: 12px;
    }

    #empty1 a {
        color: #3366CC;
    }
</style>
</head>
<body>
<?php $this->load->view('common/header.php'); ?>
<!--删除单个商品弹窗-->
<div class="popup_content_alert pb22 dn">
    <span class="login_tig tac">你确定要删除此条记录</span>
    <div class="ovh w224 center mt40">
        <div class="fl mr19">
            <input type="submit" class="iSubmit w102 h34 sEnter" value="" onclick="delOneItem(this);"/>
        </div>
        <div class="fl">
            <input type="button" class="iSubmit w102 h34 sChannel" value="" onclick="hidePop()"/>
        </div>
    </div>
</div>
<!--批量删除商品弹窗-->
<div class="popup_content_checked pb22 dn">
    <span class="login_tig tac">你确定要删除这些商品</span>
    <div class="ovh w224 center mt40">
        <div class="fl mr19">
            <input type="submit" class="iSubmit w102 h34 sEnter" value="" onclick="delOneItem(this);"/>
        </div>
        <div class="fl">
            <input type="button" class="iSubmit w102 h34 sChannel" value="" onclick="hidePop()"/>
        </div>
    </div>
</div>
<!--批量删除商品弹窗（未选中）-->
<div class="popup_content_noChecked pb22 dn">
    <span class="login_tig tac">请选择你需要删除的商品</span>
    <div class="ovh w224 center mt40">
        <div class="fl mr19">
            <input type="submit" class="iSubmit w102 h34 sEnter" value="" onclick="delOneItem(this);"/>
        </div>
        <div class="fl">
            <input type="button" class="iSubmit w102 h34 sChannel" value="" onclick="hidePop()"/>
        </div>
    </div>
</div>

<div class="bg">
    <div id="content">

        <!--购物车当前状态-->
        <div class="current-state">
            <ul>
                <li class="first-li curr"><span>1</span>查看购物车</li>
                <li class="second-li"><span>2</span>拍下商品</li>
                <li class="third-li"><span>3</span>付款</li>
                <li class="fouth-li"><span>4</span>确认收货</li>
                <li class="last-li"><span>5</span>评价</li>
            </ul>
        </div>


        <?php if (count($data)): ?>

            <div id="J_Cart">
                <div id="J_FilterBar" class="cart-filter-bar">
                    <!-- <div id="J_StatusBar" class="status-bar"><span class="bar-title">购物车状态:</span>

                        <div class="bar">
                            <div class="normal" title="正常宝贝6件" style="width: 13.799999999999999px;"></div>
                            <div class="invalid" title="失效宝贝0件" style="width: 0px;"></div>
                        </div>
                        <div class="stats"><em class="num">0</em>/<em class="num">50</em></div>
                    </div> -->
                    <div style="float:left;font-size: 14px;">购物车<span id="goodsnum">1</span>/200</div>
                    <div id="J_CartSwitch" class="switch-cart"></div>
                    <ul class="cart-filters">
                        <li class="active"><a href="#">全部</a></li>
                        <li><a href="#">降价商品<span>（<em>0</em>）</span></a></li>
                        <li><a href="#">库存紧张<span>（<em>0</em>）</span></a></li>
                    </ul>
                    <div class="cart-sum">
                        已选商品(不含运费)：<strong class="price">¥<em id="J_SmallTotal"></em></strong><!--<a id="J_SmallSubmit"
                                                                                     class="submit-btn submit-btn-disabled">结算</a>-->
                    </div>
                </div>
                <div id="J_load">
                    <div id="J_CartMain" class="cart-main">
                        <div class="J_FloatBar_box1" style="position:relative;">
                            <div class="cart-table-th" id="cart-table-th">
                                <div class="wp">
                                    <div class="th th-chk">
                                        <div id="J_SelectAll1" class="select-all J_SelectAll"><span
                                                    class="s-checkbox"></span>&nbsp;&nbsp;全选
                                        </div>
                                    </div>
                                    <div class="th th-item">商品</div>
                                    <div class="th th-info">商品信息</div>
                                    <div class="th th-price">单价</div>
                                    <div class="th th-amount">数量</div>
                                    <div class="th th-sum">小计</div>
                                    <div class="th th-op">操作</div>
                                </div>
                            </div>
                        </div>
                        <div id="J_OrderList">
                            <div id="" class="J_Order clearfix order-body all-select">
                                <div class="J_ItemHead shop clearfix">
                                    <div clcass="shop-info">
                                        <span lass="s-checkbox J_forShop"></span>&nbsp;&nbsp;<span class=""></span>
                                        店铺：
                                        <a href="<?php echo base_url('office'); ?>" target="_blank"
                                           title="文具1号超市" class="J_MakePoint">文具1号超市</a>
                                    </div>
                                </div>

                                <?php foreach ($data as $key => $value): ?>
                                    <?php if($value[0]['adjust_price']):?>
                                        <?php $value[0]['goods_price'] = $value[0]['adjust_price']?>
                                    <?php endif;?>
                                    <div class="order-content">
                                        <div class="item-list">
                                            <div class="bundle  bundle-last">
                                                <div class="J_ItemBody item-body clearfix item-normal  first-item  last-item selected posR"
                                                     gdata-goodsId="<?= $value['id'] ?>">
                                                    <ul class="item-content clearfix">
                                                        <li class="td td-chk">
                                                            <div class="td-inner"><span class="goodsnumber"><?= $key + 1 ?></span><span class="s-checkbox J_CheckBoxItem" val="<?= $value['id'] ?>"></span></div>
                                                        </li>
                                                        <li class="td td-item">
                                                            <div class="td-inner">
                                                                <div class="item-pic J_ItemPic img-loaded"><a href="<?php echo base_url() ?>goods/detail?id=<?= $value[0]['goods_id'] ?>" target="_blank" class="J_MakePoint"><img src="<?= $value[0]['goods_main_img'] ?>" class="itempic J_ItemImg"></a></div>
                                                                <div class="item-info"><a href="<?php echo base_url(); ?>goods/detail?id=<?= $value[0]['goods_id'] ?>" target="_blank" class="item-title J_MakePoint"><?= $value[0]['goods_name'] ?></a>
                                                                </div>
                                                            </div>
                                                        </li>
                                                        <li class="td td-info">
                                                            <div class="item-props item-props-can">
                                                                <?php foreach ($value[0]['goods_attr'] as $k => $v): ?><p class="sku-line"><?= $v['name'] ?> : <a href="javascript:void(0);"><?= $v['value'] ?></a></p>
                                                                <?php endforeach; ?>
                                                            </div>
                                                        </li>
                                                        <li class="td td-price">
                                                            <div class="td-inner">
                                                                <div class="item-price">
                                                                    <div class="price-line"><em class="J_Price price-now" tabindex="0"><?= $value[0]['goods_price'] ?></em>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </li>
                                                        <li class="td td-amount">
                                                            <div class="td-inner">
                                                                <div class="item-amount ">
                                                                    <a href="javascript:void(0)"
                                                                       class="J_Minus <?php if ($value['num'] == 1): ?>no-minus<?php endif; ?> "
                                                                       val="<?= $value['id'] ?>">-</a>
                                                                    <input type="text" value="<?= $value['num'] ?>" autocomplete="off" class="text text-amount J_ItemAmount" val="<?= $value['id'] ?>" onkeyup="value=value.replace(/[^\d]/g,'')">
                                                                    <a href="javascript:void(0)" class="J_Plus plus"
                                                                       val="<?= $value['id'] ?>">+</a>
                                                                </div>
                                                                <div></div>
                                                            </div>
                                                        </li>
                                                        <li class="td td-sum">
                                                            <div class="td-inner"><em class="J_ItemSum number"><?= $value[0]['goods_price'] * $value['num'] ?></em>
                                                            </div>
                                                        </li>
                                                        <li class="td td-op">
                                                            <div class="td-inner">
                                                                <!--                                                    <a title="移至收藏夹" class="fav J_Fav J_MakePoint" href="#">-->
                                                                <!--                                                        移入收藏夹-->
                                                                <!--                                                    </a>-->
                                                                <a href="javascript:;" class="J_Del J_MakePoint">删除</a>
                                                            </div>
                                                        </li>
                                                    </ul>
                                                    <p class="item-body-notice">
                                                        <?php if ($identity != 1): ?>
                                                            <?php if ($single_quota < $value[0]['goods_price'] && $single_quota != 0): ?>
                                                                <span class="icon"></span>
                                                                该商品已超出单品预算<?= ($value[0]['goods_price'] - $single_quota) ?>元
                                                            <?php endif; ?>
                                                            <?php if ($list_id && !in_array($value['product_id'], $list_id)): ?>
                                                                <span class="icon"></span>
                                                                该商品已经超出您的商品选购范围
                                                            <?php endif; ?>

                                                        <?php endif; ?>
                                                    </p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        </div>
                        <script>document.getElementById('goodsnum').innerHTML = '1';</script>
                    </div>
                </div>
                <form method="post" action="<?php echo base_url(); ?>order/detail" id="submit-ids">
                    <input type="hidden" id="ids" name="ids">
                </form>
                <div class="J_FloatBar_box" style="position:relative;">
                    <div id="J_FloatBar" class="float-bar clearfix fixed-bottom">
                        <div id="J_SelectedItems" class="group-wrapper group-popup hidden" style="display: none;">
                            <div id="J_SelectedItemsList" class="group-content"></div>
                            <span class="arrow" style="left: 670px;"></span></div>
                        <div class="float-bar-wrapper">
                            <div id="J_SelectAll2" class="select-all J_SelectAll selected"><span
                                        class="s-checkbox"></span>&nbsp;全选
                            </div>
                            <div class="operations">
                                <a href="javascript:void(0);" class="J_DeleteSelected">删除</a>
                                <a href="#" class="J_ClearInvalid hidden">清除失效宝贝</a>
                                <!--                            <a href="#" class="J_BatchFav">批量移入收藏夹</a>-->

                                <?php if ($identity != 1 && $total_quota != 0): ?>
                                    <span class="operations-budget">当前可用预算：<em
                                                class="color-red">¥<?= $total_quota_left ?></em></span>
                                <?php endif; ?>
                            </div>
                            <div class="float-bar-right">
                                <div id="J_ShowSelectedItems" class="amount-sum"><span class="txt">已选商品</span><em
                                            id="J_SelectedItemsCount">1</em><span class="txt">种</span>

                                    <!--<div class="arrow-box"><span class="selected-items-arrow"></span><span class="arrow"></span></div>-->
                                </div>
                                <!--<div id="J_CheckCOD" class="check-cod" style="display: none;"><span class="icon-cod"></span><span-->
                                <!--class="s-checkbox J_CheckCOD"></span>货到付款-->
                                <!--</div>-->
                                <div class="pipe"></div>
                                <div class="price-sum"><span class="txt">合计(不含运费)：</span><strong class="price">¥<em
                                                id="J_Total"></em></strong>
                                </div>
                                <div class="btn-area"><a id="J_Go" class="submit-btn"><span>结算</span><!-- <b></b> -->
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        <?php else: ?>
            <div id="J_Cart">
                <div id="empty1"><h2>购物车空空的哦~,去看看心仪的商品吧~</h2>
                    <ul>
                        <li><a href="<?php echo base_url('office'); ?>" target="_blank">去购物&gt;</a>
                        </li>
                    </ul>
                </div>
            </div>

        <?php endif; ?>
        <!--<div class="testfoot"></div>-->
    </div>
</div>
<?php $this->load->view('common/bottom.php'); ?>
<script type="text/javascript" src="public/js/layer.js?v=1523346815"></script>
<script type="text/javascript" src="public/js/layerUtils.js?v=1523346818"></script>
<script type="text/javascript" src="public/js/buyNew.js.js?v=1523346818"></script>
<script type="text/javascript" src="public/js/buyer_cart.js?v=<?php echo time();?>"></script>
<script type="text/javascript" src="public/js/cart_timeover.js?v=1523346815"></script>
<script>
    $(function(){
         $('.submit-btn').click(function () {
        if (parseInt($('#goodsnum').text()) > 200) {
            alert('购物车商品已超200种');
            return false;
        }
        var reqUrl = $(this).attr("href");

        if (!$(this).hasClass("submit-btn-disabled")) {
            var ids = '';
            $(".J_CheckBoxItem").each(function () {
                var itemBody = $(this).parents(".item-body");
                if (itemBody.hasClass("selected")) {
                    var id = $(this).attr('val')
                    ids += id + ','
                }
            });
            ids = ids.substring(0, ids.length - 1)
            $.post("cart/add_shop_cart", {ids: ids}, function (res) {
                if (res.code == 0) {
                    // $("#ids").val(ids);
                    // $("#submit-ids").submit();
                    $.post("order/submit", {ids: ids}, function (res) {
                        if (res.code == -2) {
                            layer.msg(res.msg);
                            setTimeout(function () {
                                location.href = shop_url+"mMLogin.html";
                            }, 1000)
                        } else if (res.code == -1) {
                            layer.msg(res.msg);
                        } else {
                            location.href = "<?php echo base_url()?>order/detail";
                        }
                    });
                } else {
                    alert(res.msg);
                }
            }, "json")

        }
        return false;
    });
    })

</script>

</body>
</html>